#include "BiTree.h"
int main()
{
    TNode *n1 = BuyTreeNode(1);
    TNode *n2 = BuyTreeNode(2);
    TNode *n3 = BuyTreeNode(3);
    TNode *n4 = BuyTreeNode(4);
    TNode *n6 = BuyTreeNode(6);
    TNode *n7 = BuyTreeNode(7);
    TNode *n11 = BuyTreeNode(11);
    TNode *n12 = BuyTreeNode(12);
    n1->left_ = n2;
    n1->right_ = n3;
    n2->right_ = n4;
    n3->left_ = n6;
    n3->right_ = n7;
    n4->right_ = n11;
    n6->left_ = n12;
    // LevelOrder(n1);
    // printf("\n");
    // TNode *n = BinaryTreeFind(n1, 12);
    // if (n)
    //     printf("%d\n", n->data_);
    // else
    //     printf("NULL\n");
    // int h = hight(n1);
    // printf("%d\n", h);
    int a[] = {1, 2, 4, 8, 0, 0, 9, 0, 0, 5, 10, 0, 0, 11, 0, 0, 3, 6, 12, 0, 0, 13, 0, 0, 7, 14, 0, 0, 15, 0, 0};
    int i = 0;
    TNode *tmp = BinaryTreeCreate(a, &i);
    PreOrder(tmp);
    printf("\n");

    BinaryTreeDestory(&n1);
    return 0;
}